﻿using Domain.Entity.System_setting;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configer.System_setting
{
    public class RoleConfiger : IEntityTypeConfiguration<Ment_role>
    {
        public void Configure(EntityTypeBuilder<Ment_role> builder)
        {
            builder.ToTable(nameof(Ment_role));
            builder.HasKey(e => e.Role_id);
            builder.Property(e => e.Role_id).HasColumnType("bigint");
            builder.Property(e => e.Role_name).HasColumnType("varchar(64)");
            builder.Property(e => e.Role_title).HasColumnType("varchar(500)");
            builder.Property(e => e.Role_status).HasColumnType("tinyint").HasComment("角色状态：0、启用 1、禁用");
            builder.Property(e => e.Create_by).HasColumnType("varchar(64)").IsRequired();
            builder.Property(e => e.Create_time).HasColumnType("DateTime");
            builder.Property(e => e.Update_by).HasColumnType("varchar(64)").IsRequired(false);
            builder.Property(e => e.Update_time).HasColumnType("DateTime");
            builder.Property(e => e.Is_del).HasColumnType("tinyint").IsRequired().HasComment("删除状态：0、未删除 1、已删除");
        }
    }
}
